<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>RegularExpression.pb</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<pre><font face="Courier New, Courier, mono"size="2"><font color="#006666">;
</font><font color="#006666">; ------------------------------------------------------------
</font><font color="#006666">;
</font><font color="#006666">;   PureBasic - RegularExpression example file
</font><font color="#006666">;
</font><font color="#006666">;    (c) Fantaisie Software
</font><font color="#006666">;
</font><font color="#006666">; ------------------------------------------------------------
</font><font color="#006666">;
</font>
<font color="#006666">; Will match every word of 3 letters, lowercase with a 'b' as middle letter
</font><font color="#006666">;
</font><b><font color="#006666">If</font></b> <font color="#006666">CreateRegularExpression</font>(0, "[a-z]b[a-z]")

  <b><font color="#006666">Dim</font></b> <font color="#006666">Result$</font>(0)
  
  a =<font color="#006666"> ExtractRegularExpression</font>(0, " abc it won't match abz",<font color="#006666"> result$</font>())
  
<font color="#006666">  MessageRequester</font>("Info", "Nb strings found: "+<font color="#006666">Str</font>(a))
  
  <b><font color="#006666">For</font></b> k=0 <b><font color="#006666">To</font></b> a-1
<font color="#006666">    MessageRequester</font>("Info",<font color="#006666"> Result$</font>(k))
  <b><font color="#006666">Next</font></b>

<b><font color="#006666">Else</font></b>
<font color="#006666">  MessageRequester</font>("Error",<font color="#006666"> RegularExpressionError</font>())
<b><font color="#006666">EndIf</font></b>
</font></pre>
</body></html>
